<template>
  <div class="user-center-container">
    <!-- 顶部导航栏 -->
    <TopNavBar />

    <el-container class="main-container">
      <el-main class="main-content">
        <div class="content-wrapper">
          <!-- 用户信息卡片 -->
          <div class="user-info-section">
            <CardContainer>
              <CardBody class="user-info-card">
                <div class="user-avatar-section">
                  <div class="avatar-container">
                    <el-avatar :size="120" class="user-avatar">
                      <img
                        v-if="userInfo.avatar"
                        :src="userInfo.avatar"
                        alt="用户头像"
                        class="avatar-img"
                      />
                      <el-icon v-else><User /></el-icon>
                    </el-avatar>
                    <div class="avatar-upload-btn">
                      <el-upload
                        :auto-upload="false"
                        :show-file-list="false"
                        :before-upload="beforeAvatarUpload"
                        :on-change="handleAvatarChange"
                        accept="image/*"
                      >
                        <el-button
                          size="small"
                          type="primary"
                          :loading="avatarUploading"
                        >
                          <el-icon v-if="!avatarUploading"><Upload /></el-icon>
                          {{ avatarUploading ? "上传中..." : "更换头像" }}
                        </el-button>
                      </el-upload>
                    </div>
                  </div>
                  <div class="user-details">
                    <h2 class="user-name">
                      {{ userInfo.username || "薇启用户" }}
                    </h2>
                    <p class="user-email">
                      {{ userInfo.email || "user@example.com" }}
                    </p>
                    <p class="user-phone">
                      {{ userInfo.phonenumber || "未设置手机号" }}
                    </p>
                    <div class="user-stats">
                      <div class="stat-item">
                        <span class="stat-number">{{
                          userInfo.learningDays || 0
                        }}</span>
                        <span class="stat-label">学习天数</span>
                      </div>
                      <div class="stat-item">
                        <span class="stat-number">{{
                          userInfo.totalSessions || 0
                        }}</span>
                        <span class="stat-label">对话次数</span>
                      </div>
                      <div class="stat-item">
                        <span class="stat-number">{{
                          userInfo.completedTasks || 0
                        }}</span>
                        <span class="stat-label">完成任务</span>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="user-actions">
                  <el-button type="primary" @click="editProfile"
                    >编辑资料</el-button
                  >
                  <el-button @click="changePassword">修改密码</el-button>
                </div>
              </CardBody>
            </CardContainer>
          </div>

          <!-- 功能菜单 -->
          <div class="features-section">
            <h3 class="section-title">
              <SparklesText
                text="个人功能"
                :colors="{ first: '#9E7AFF', second: '#FE8BBB' }"
                :sparkles-count="5"
              />
            </h3>

            <div class="features-grid">
              <CardContainer @click="navigateTo('learning-history')">
                <CardBody class="feature-card">
                  <CardItem :translate-z="100" class="feature-icon">
                    <el-icon size="40" color="#409EFF">
                      <Document />
                    </el-icon>
                  </CardItem>
                  <CardItem :translate-z="60" class="feature-title">
                    学习记录
                  </CardItem>
                  <CardItem :translate-z="50" class="feature-description">
                    查看你的学习历程和进展
                  </CardItem>
                </CardBody>
              </CardContainer>

              <CardContainer @click="navigateTo('favorites')">
                <CardBody class="feature-card">
                  <CardItem :translate-z="100" class="feature-icon">
                    <el-icon size="40" color="#F56C6C">
                      <Star />
                    </el-icon>
                  </CardItem>
                  <CardItem :translate-z="60" class="feature-title">
                    我的收藏
                  </CardItem>
                  <CardItem :translate-z="50" class="feature-description">
                    管理你收藏的重要内容
                  </CardItem>
                </CardBody>
              </CardContainer>

              <CardContainer @click="navigateTo('achievements')">
                <CardBody class="feature-card">
                  <CardItem :translate-z="100" class="feature-icon">
                    <el-icon size="40" color="#67C23A">
                      <Trophy />
                    </el-icon>
                  </CardItem>
                  <CardItem :translate-z="60" class="feature-title">
                    成就徽章
                  </CardItem>
                  <CardItem :translate-z="50" class="feature-description">
                    查看你获得的成就和徽章
                  </CardItem>
                </CardBody>
              </CardContainer>

              <CardContainer @click="navigateTo('settings')">
                <CardBody class="feature-card">
                  <CardItem :translate-z="100" class="feature-icon">
                    <el-icon size="40" color="#E6A23C">
                      <Setting />
                    </el-icon>
                  </CardItem>
                  <CardItem :translate-z="60" class="feature-title">
                    个人设置
                  </CardItem>
                  <CardItem :translate-z="50" class="feature-description">
                    个性化设置和偏好配置
                  </CardItem>
                </CardBody>
              </CardContainer>

              <CardContainer @click="navigateTo('feedback')">
                <CardBody class="feature-card">
                  <CardItem :translate-z="100" class="feature-icon">
                    <el-icon size="40" color="#909399">
                      <Message />
                    </el-icon>
                  </CardItem>
                  <CardItem :translate-z="60" class="feature-title">
                    意见反馈
                  </CardItem>
                  <CardItem :translate-z="50" class="feature-description">
                    帮助我们改进产品体验
                  </CardItem>
                </CardBody>
              </CardContainer>

              <CardContainer @click="logout">
                <CardBody class="feature-card logout-card">
                  <CardItem :translate-z="100" class="feature-icon">
                    <el-icon size="40" color="#F56C6C">
                      <SwitchButton />
                    </el-icon>
                  </CardItem>
                  <CardItem :translate-z="60" class="feature-title">
                    退出登录
                  </CardItem>
                  <CardItem :translate-z="50" class="feature-description">
                    安全退出当前账户
                  </CardItem>
                </CardBody>
              </CardContainer>
            </div>
          </div>

          <!-- 最近活动 -->
          <div class="recent-activity-section">
            <h3 class="section-title">
              <RadiantText :duration="3">
                <span class="activity-title">最近活动</span>
              </RadiantText>
            </h3>

            <div class="activity-list">
              <div
                v-for="(activity, index) in recentActivities"
                :key="index"
                class="activity-item"
              >
                <div class="activity-icon">
                  <el-icon :color="activity.color">
                    <component :is="activity.icon" />
                  </el-icon>
                </div>
                <div class="activity-content">
                  <p class="activity-title">{{ activity.title }}</p>
                  <p class="activity-time">{{ activity.time }}</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </el-main>
    </el-container>

    <!-- 底部导航 -->
    <BotmNav />

    <!-- 编辑资料对话框 -->
    <el-dialog v-model="editProfileVisible" title="编辑个人资料" width="500px">
      <el-form
        ref="userRef"
        :model="editForm"
        :rules="rules"
        label-width="80px"
      >
        <el-form-item label="用户名">
          <el-input
            v-model="editForm.username"
            placeholder="请输入用户名"
            readonly
          />
        </el-form-item>
        <el-form-item label="邮箱" prop="email">
          <el-input v-model="editForm.email" placeholder="请输入邮箱" />
        </el-form-item>
        <el-form-item label="手机号" prop="phonenumber">
          <el-input
            v-model="editForm.phonenumber"
            placeholder="请输入手机号"
            maxlength="11"
          />
        </el-form-item>
        <el-form-item label="个人简介">
          <el-input
            v-model="editForm.bio"
            type="textarea"
            :rows="3"
            placeholder="请输入个人简介"
          />
        </el-form-item>
      </el-form>
      <template #footer>
        <el-button @click="cancelEdit">取消</el-button>
        <el-button type="primary" @click="saveProfile">保存</el-button>
      </template>
    </el-dialog>

    <!-- 修改密码对话框 -->
    <el-dialog v-model="changePasswordVisible" title="修改密码" width="500px">
      <el-form
        ref="pwdRef"
        :model="passwordForm"
        :rules="passwordRules"
        label-width="100px"
      >
        <el-form-item label="当前密码" prop="oldPassword">
          <el-input
            v-model="passwordForm.oldPassword"
            type="password"
            placeholder="请输入当前密码"
            show-password
          />
        </el-form-item>
        <el-form-item label="新密码" prop="newPassword">
          <el-input
            v-model="passwordForm.newPassword"
            type="password"
            placeholder="请输入新密码"
            show-password
          />
        </el-form-item>
        <el-form-item label="确认密码" prop="confirmPassword">
          <el-input
            v-model="passwordForm.confirmPassword"
            type="password"
            placeholder="请再次输入新密码"
            show-password
          />
        </el-form-item>
      </el-form>
      <template #footer>
        <el-button @click="changePasswordVisible = false">取消</el-button>
        <el-button type="primary" @click="savePassword">确认修改</el-button>
      </template>
    </el-dialog>
  </div>
</template>

<script setup>
import { ref, onMounted } from "vue";
import { useRouter } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus";
import TopNavBar from "@/components/TopNavBar.vue";
import BotmNav from "@/components/BotmNav.vue";
import SparklesText from "@/components/SparklesText.vue";
import RadiantText from "@/components/RadiantText.vue";
import { CardContainer, CardBody, CardItem } from "@/components/ui/card-3d";
import {
  User,
  Document,
  Star,
  Trophy,
  Setting,
  Message,
  SwitchButton,
  ChatRound,
  EditPen,
  Clock,
  Upload,
} from "@element-plus/icons-vue";
import { formatDate } from "@/util/formatDate.js";
import requestUtil from "@/util/request.js";
import userApi from "@/api/user.js";

const router = useRouter();

// 获取用户信息
const getCurrentUserInfo = () => {
  const storedUserInfo = sessionStorage.getItem("userInfo");
  if (storedUserInfo) {
    return JSON.parse(storedUserInfo);
  }

  // 如果没有，返回默认值
  return {
    id: null,
    username: "薇启用户",
    email: "vichi@example.com",
    phonenumber: "",
    avatar: "",
    roles: "用户",
    loginDate: new Date(),
    learningDays: 15,
    totalSessions: 128,
    completedTasks: 45,
    articleCount: 0,
    commentCount: 0,
    likeCount: 0,
    followerCount: 0,
    bio: "探索无限可能，与薇启智慧同行",
  };
};

// 用户信息
const userInfo = ref(getCurrentUserInfo());

// 头像上传相关
const avatarUploading = ref(false);

// 头像上传前的验证
const beforeAvatarUpload = (file) => {
  const isImage = file.type.startsWith("image/");
  const isLt2M = file.size / 1024 / 1024 < 2;

  if (!isImage) {
    ElMessage.error("上传头像只能是图片格式!");
    return false;
  }
  if (!isLt2M) {
    ElMessage.error("上传头像大小不能超过 2MB!");
    return false;
  }
  return true;
};

// 文件选择变化时触发
const handleAvatarChange = async (file) => {
  if (!beforeAvatarUpload(file.raw)) {
    return;
  }

  avatarUploading.value = true;

  try {
    // 创建 FormData 对象
    const formData = new FormData();
    formData.append("file", file.raw);

    // 使用 userApi 上传文件
    const response = await userApi.uploadFile(formData);

    if (response.data.code === 200) {
      // 头像上传成功，获取返回的URL
      console.log("头像上传成功，返回的数据:", response.data);
      const avatarUrl = response.data.data.url || response.data.data; // 兼容不同的后端返回格式

      // 调用后端API更新用户头像
      try {
        const result = await userApi.updateAvatar({
          id: userInfo.value.id,
          avatar: avatarUrl,
        });

        if (result.data.code === 200) {
          // 更新本地用户信息
          userInfo.value.avatar = avatarUrl;
          sessionStorage.setItem("userInfo", JSON.stringify(userInfo.value));
          ElMessage.success("头像更新成功！");
        } else {
          ElMessage.error(result.data.msg || "头像保存失败，请重试");
        }
      } catch (error) {
        console.error("调用后端API保存头像失败:", error);
        ElMessage.error("头像保存失败，请重试");
      }
    } else {
      ElMessage.error(response.data.msg || "头像上传失败");
    }
  } catch (error) {
    console.error("头像上传失败:", error);
    ElMessage.error("头像上传失败，请重试");
  } finally {
    avatarUploading.value = false;
  }
};

// 编辑资料相关
const editProfileVisible = ref(false);
const editForm = ref({
  id: userInfo.value.id,
  username: userInfo.value.username,
  email: userInfo.value.email,
  phonenumber: userInfo.value.phonenumber,
  bio: userInfo.value.bio,
});

// 表单验证规则
const userRef = ref(null);
const rules = ref({
  email: [
    { required: true, message: "邮箱地址不能为空", trigger: "blur" },
    {
      type: "email",
      message: "请输入正确的邮箱地址",
      trigger: ["blur", "change"],
    },
  ],
  phonenumber: [
    { required: true, message: "手机号码不能为空", trigger: "blur" },
    {
      pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
      message: "请输入正确的手机号码",
      trigger: "blur",
    },
  ],
});

// 修改密码相关
const changePasswordVisible = ref(false);
const pwdRef = ref(null);
const passwordForm = ref({
  id: userInfo.value.id,
  oldPassword: "",
  newPassword: "",
  confirmPassword: "",
});

// 修改密码表单验证规则
const equalToPassword = (rule, value, callback) => {
  if (passwordForm.value.newPassword !== value) {
    callback(new Error("两次输入的密码不一致"));
  } else {
    callback();
  }
};

const passwordRules = ref({
  oldPassword: [{ required: true, message: "旧密码不能为空", trigger: "blur" }],
  newPassword: [
    { required: true, message: "新密码不能为空", trigger: "blur" },
    { min: 6, max: 20, message: "长度在 6 到 20 个字符", trigger: "blur" },
  ],
  confirmPassword: [
    { required: true, message: "确认密码不能为空", trigger: "blur" },
    { required: true, validator: equalToPassword, trigger: "blur" },
  ],
});

// 最近活动数据
const recentActivities = ref([
  {
    icon: "ChatRound",
    title: "完成了一次AI对话学习",
    time: "2小时前",
    color: "#409EFF",
  },
  {
    icon: "Document",
    title: "查看了学习记录",
    time: "1天前",
    color: "#67C23A",
  },
  {
    icon: "Star",
    title: "收藏了重要内容",
    time: "2天前",
    color: "#F56C6C",
  },
  {
    icon: "Trophy",
    title: "获得了新的成就徽章",
    time: "3天前",
    color: "#E6A23C",
  },
]);

// 导航方法
const navigateTo = (path) => {
  ElMessage.info(`${path} 功能正在开发中...`);
  // router.push(`/${path}`);
};

// 编辑资料
const editProfile = () => {
  editForm.value = {
    id: userInfo.value.id,
    username: userInfo.value.username,
    email: userInfo.value.email,
    phonenumber: userInfo.value.phonenumber,
    bio: userInfo.value.bio,
  };
  editProfileVisible.value = true;
};

// 保存资料
const saveProfile = () => {
  userRef.value.validate(async (valid) => {
    if (valid) {
      try {
        // 调用后端API保存用户信息
        const result = await userApi.updateUser({
          id: editForm.value.id,
          username: editForm.value.username,
          email: editForm.value.email,
          phonenumber: editForm.value.phonenumber,
          // bio字段后端可能不支持，先注释掉
          // bio: editForm.value.bio,
        });

        const data = result.data;
        console.log("保存用户信息结果:", data);

        if (data.code === 200) {
          // 更新本地用户信息
          userInfo.value = { ...userInfo.value, ...editForm.value };
          sessionStorage.setItem("userInfo", JSON.stringify(userInfo.value));

          editProfileVisible.value = false;
          ElMessage.success("个人资料已更新！");
        } else {
          ElMessage.error(data.msg || "保存失败");
        }
      } catch (error) {
        console.error("保存用户信息失败:", error);
        ElMessage.error("保存失败，请重试");
      }
    }
  });
};

// 取消编辑
const cancelEdit = () => {
  editProfileVisible.value = false;
};

// 修改密码
const changePassword = () => {
  passwordForm.value = {
    id: userInfo.value.id,
    oldPassword: "",
    newPassword: "",
    confirmPassword: "",
  };
  changePasswordVisible.value = true;
};

// 保存密码
const savePassword = () => {
  pwdRef.value.validate(async (valid) => {
    if (valid) {
      try {
        const result = await userApi.updatePassword({
          id: passwordForm.value.id,
          oldPassword: passwordForm.value.oldPassword,
          newPassword: passwordForm.value.newPassword,
        });

        const data = result.data;

        if (data.code === 200) {
          changePasswordVisible.value = false;
          // 重置表单
          passwordForm.value = {
            id: userInfo.value.id,
            oldPassword: "",
            newPassword: "",
            confirmPassword: "",
          };
          ElMessage.success("密码修改成功，下一次登录生效！");
        } else {
          ElMessage.error(data.msg || "密码修改失败");
        }
      } catch (error) {
        console.error("修改密码失败:", error);
        ElMessage.error("密码修改失败，请重试");
      }
    }
  });
};

// 退出登录
const logout = async () => {
  try {
    await ElMessageBox.confirm("确定要退出登录吗？", "提示", {
      confirmButtonText: "确定",
      cancelButtonText: "取消",
      type: "warning",
    });

    // 清除本地存储的用户信息
    localStorage.removeItem("token");
    localStorage.removeItem("userInfo");
    sessionStorage.removeItem("userInfo");

    ElMessage.success("已退出登录");
    router.push("/login");
  } catch {
    // 用户取消退出
  }
};

// 从后端获取当前用户信息
const fetchCurrentUserInfo = async () => {
  try {
    const result = await userApi.getCurrentUser();
    if (result.data.code === 200) {
      const currentUser = result.data.data.sysUser || result.data.data;

      // 保留前端的一些额外字段
      userInfo.value = {
        ...userInfo.value,
        ...currentUser,
        // 保持前端的统计数据
        learningDays: userInfo.value.learningDays || 15,
        totalSessions: userInfo.value.totalSessions || 128,
        completedTasks: userInfo.value.completedTasks || 45,
      };
      sessionStorage.setItem("userInfo", JSON.stringify(userInfo.value));
      console.log("用户信息获取成功:", userInfo.value);
    } else {
      console.warn("获取用户信息失败:", result.data.msg);
    }
  } catch (error) {
    console.warn("获取用户信息失败，使用本地缓存:", error);
  }
};

// 页面加载时获取用户信息
onMounted(() => {
  // 从后端获取最新的用户信息
  fetchCurrentUserInfo();
  console.log("当前用户信息:", userInfo.value);
});
</script>

<style scoped>
.user-center-container {
  min-height: 100vh;
  background-color: #f5f7fa;
}

.main-container {
  padding-top: 0;
}

.main-content {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

/* 用户信息卡片 */
.user-info-section {
  margin-bottom: 30px;
}

.user-info-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 30px;
  color: white;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border: none;
}

.user-avatar-section {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-bottom: 30px;
}

.avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.user-avatar {
  background: rgba(255, 255, 255, 0.2);
  border: 3px solid rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-btn {
  display: flex;
  justify-content: center;
}

.avatar-upload-btn .el-button {
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #333;
  transition: all 0.3s;
}

.avatar-upload-btn .el-button:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-details {
  flex: 1;
}

.user-name {
  font-size: 28px;
  font-weight: bold;
  margin: 0 0 10px 0;
  color: white;
}

.user-email {
  font-size: 16px;
  opacity: 0.8;
  margin: 0 0 5px 0;
}

.user-phone {
  font-size: 14px;
  opacity: 0.7;
  margin: 0 0 20px 0;
}

.user-stats {
  display: flex;
  gap: 30px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 24px;
  font-weight: bold;
  color: #ffd700;
}

.stat-label {
  font-size: 14px;
  opacity: 0.8;
}

.user-actions {
  display: flex;
  gap: 15px;
}

.user-actions .el-button {
  border-radius: 25px;
  padding: 10px 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transition: all 0.3s;
}

.user-actions .el-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.user-actions .el-button--primary {
  background: #ffd700;
  border-color: #ffd700;
  color: #333;
}

.user-actions .el-button--primary:hover {
  background: #fff700;
  border-color: #fff700;
}

/* 功能区域 */
.features-section {
  margin-bottom: 30px;
}

.section-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.feature-card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(64, 158, 255, 0.1);
  margin: 0 auto 15px;
}

.feature-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
}

.feature-description {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.logout-card {
  border-color: rgba(245, 108, 108, 0.2);
}

.logout-card:hover {
  border-color: rgba(245, 108, 108, 0.5);
  background: rgba(245, 108, 108, 0.02);
}

/* 最近活动 */
.recent-activity-section {
  margin-bottom: 30px;
}

.activity-title {
  background: linear-gradient(135deg, #9e7aff 0%, #fe8bbb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 24px;
  font-weight: bold;
}

.activity-list {
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.activity-item {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #f0f0f0;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(64, 158, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

.activity-content {
  flex: 1;
}

.activity-content .activity-title {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 5px;
  background: none;
  -webkit-text-fill-color: #333;
}

.activity-time {
  font-size: 14px;
  color: #999;
  margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .user-avatar-section {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .avatar-container {
    margin-bottom: 15px;
  }

  .user-stats {
    justify-content: center;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .user-actions {
    justify-content: center;
  }
}

/* 对话框样式 */
.el-dialog {
  border-radius: 15px;
}

.el-dialog__header {
  padding: 20px 20px 10px;
}

.el-dialog__body {
  padding: 10px 20px 20px;
}

.el-form-item {
  margin-bottom: 20px;
}

.el-input {
  border-radius: 8px;
}

.el-button {
  border-radius: 8px;
}
</style>
